#include #include #include int main() { const int pir_pin=24; wiringPiSetup(); pinMode(pir_pin, INPUT); char command[80]=""; int num=0; while(1){ if(digitalRead(pir_pin)==HIGH){ puts("PIR sensor: on"); ++num; sprintf(command, "raspistill -n -t 1 -w 1920 -h 1080 -o picture%d.jpg", num); system(command); } delay(1000); } return 0; }